//
//  XFXTopicDetaTableViewCell.m
//  XFXnews
//
//  Created by dllo on 16/1/30.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "XFXTopicDetaTableViewCell.h"

@interface XFXTopicDetaTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *userFhoto;
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UILabel *userDeta;
@property (weak, nonatomic) IBOutlet UIImageView *teacherPhoto;
@property (weak, nonatomic) IBOutlet UILabel *teacherName;
@property (weak, nonatomic) IBOutlet UILabel *teacherDeta;
@property (weak, nonatomic) IBOutlet UILabel *time;



@end

@implementation XFXTopicDetaTableViewCell

- (void)setModel:(XFXTopicDeatCellModel *)model{
    _model = model;
    
    NSMutableDictionary *user = [NSMutableDictionary dictionaryWithDictionary:_model.question];
    NSMutableDictionary *teacher = [NSMutableDictionary dictionaryWithDictionary:_model.answer];

    self.userName.text = [user objectForKey:@"userName"];
    self.teacherName.text = [teacher objectForKey:@"specialistName"];
    
    NSURL *userUrl = [NSURL URLWithString:[user objectForKey:@"userHeadPicUrl"]];
    [self.userFhoto sd_setImageWithURL:userUrl];
    self.userFhoto.layer.masksToBounds = YES;
    self.userFhoto.layer.cornerRadius = 20;
    
    NSURL *teacherUrl = [NSURL URLWithString:[teacher objectForKey:@"specialistHeadPicUrl"]];
    [self.teacherPhoto sd_setImageWithURL:teacherUrl];
    self.teacherPhoto.layer.cornerRadius = 20;
    self.teacherPhoto.layer.masksToBounds = YES;
   
    self.userDeta.text = [user objectForKey:@"content"];
    self.teacherDeta.text = [teacher objectForKey:@"content"];
    
    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.borderWidth = 1;
    self.contentView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.contentView.layer.masksToBounds = YES;
    
    
    
    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
